﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Directory.Web
{
    public partial class Controls_Login : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
		protected void btnLogin_Click(object sender, EventArgs e)
		{
			if (WebUtil.TryLogIn(tbName.Text, tbPassword.Text, cbIsPersistent.Checked))
			{
				Response.Redirect(FormsAuthentication.GetRedirectUrl(tbName.Text,cbIsPersistent.Checked));
			}
			else
			{
				lbMsg.Text = "用户名或密码错误。";
			}
		}
}
}
